import * as QiNiu from "qiniu-js";
let config = {
  host: "http(s)://rs-z2.qiniuapi.com",
  accessKey: "your access key",
  secretKey: "your secret key",
  expires: 7200,
  scope: "tarde-admin",
};
function QiNiuFile() {
}
QiNiuFile.prototype.upload = (file, fileName) => {
  let token = "this.token;"

  let uploadConfig = {
    useCdnDomain: true,
    region: QiNiu.region.z2,
  };
  let putExtra = {
    fname: "",
    params: {},
    mimeType: ["image/png"],
  };
  let observable = QiNiu.upload(file, fileName, token, putExtra, uploadConfig);
  return observable.subscribe(observable); // 上传开始
};
export default new QiNiuFile(config);
